package com.home.theater.facade;

import com.home.theater.Amplifier;
import com.home.theater.CdPlayer;
import com.home.theater.DvdPlayer;
import com.home.theater.PopcornPopper;
import com.home.theater.Projector;
import com.home.theater.Screen;
import com.home.theater.TheaterLights;
import com.home.theater.Tuner;

public class HomeTheaterFacade {

	private Amplifier amplifier;
	private Tuner tuner;
	private DvdPlayer dvdPlayer;
	private CdPlayer cdPlayer;
	private Projector projector;
	private TheaterLights theaterLights;
	private Screen screen;
	private PopcornPopper popcornPopper;

	public HomeTheaterFacade(Amplifier amplifier, Tuner tuner,
			DvdPlayer dvdPlayer, CdPlayer cdPlayer, Projector projector,
			TheaterLights theaterLights, Screen screen,
			PopcornPopper popcornPopper) {
		this.amplifier = amplifier;
		this.tuner = tuner;
		this.dvdPlayer = dvdPlayer;
		this.cdPlayer = cdPlayer;
		this.projector = projector;
		this.theaterLights = theaterLights;
		this.screen = screen;
		this.popcornPopper = popcornPopper;
	}

	public void watchMovie(String movie) {
		System.out.println("Get ready to watch a movie...");
		popcornPopper.on();
		popcornPopper.pop();
		theaterLights.dim(10);
		screen.down();
		projector.on();
		projector.wideScreenMode();
		amplifier.on();
		amplifier.setDvd(dvdPlayer);
		amplifier.setSurroundSound();
		amplifier.setVolume(5);
		dvdPlayer.on();
		dvdPlayer.play(movie);

	}

	public void endMovie() {
		System.out.println("Shutting movie theater down...");
		popcornPopper.off();
		theaterLights.off();
		screen.up();
		projector.off();
		amplifier.off();
		dvdPlayer.stop();
		dvdPlayer.eject();
		dvdPlayer.off();
	}

	public void listenToCd() {
	}

	public void endCd() {
	}

	public void listenToRadio() {
	}

	public void endRadio() {
	}
}
